package com.practice.java8.stream;

import java.io.BufferedReader;
import java.io.StringReader;
import java.util.Arrays;
import java.util.List;
import java.util.stream.IntStream;
import java.util.stream.Stream;

public class CreateMain {

	public static void main(String[] args) {
		createStream();
		createNumberStream();
		createReaderStream();
	}
	
	public static void createStream() {
		Stream<String> stream;
		// 1. Individual values
		stream = Stream.of("a", "b", "c");
		// 2. Arrays
		String [] strArray = new String[] {"a", "b", "c"};
		stream = Stream.of(strArray);
		stream = Arrays.stream(strArray);
		// 3. Collections
		List<String> list = Arrays.asList(strArray);
		stream = list.stream();
	}
	
	public static void createNumberStream() {
		IntStream stream;
		stream = IntStream.of(new int[]{1, 2, 3});
		stream = IntStream.range(1, 3);
		stream = IntStream.rangeClosed(1, 3);
	}
	
	public static void createReaderStream() {
		BufferedReader br = new BufferedReader(new StringReader(""));
		Stream<String> stream = br.lines();
	}
	
}
